<?php
if(@$idUser) $user_log = '<a href="'.$idUser.'/"> <img style="border:solid 1px #FF93B4" src="'.$avatar.'" /> '.$_SESSION['name'].' </a> &nbsp; | &nbsp; <a href="index.html?user='.$idUser.'&logout=1">Logout</a>';
else $user_log = '<a href="index.html">Đăng nhập</a>';

echo '<div id="header"><div style="width:1000px; margin:0 auto">
<div id="logo"><a href=""><span style="float:left">Loveheart</span></a>'.$notification.$total_ds_traloi.$view_notification.'</div>'.$search_frm.'

<div id="user">'.$user_log.'</div></div></div>';
?>
<script type="text/javascript">
$(document).ready(function(e) {
    $("#search").keyup(function(e){
		$("#box_kq").css('display','block');
		var key = e.keyCode;
		var str = $('#txtSearch').val();
		if((str!='') && (key!=13)){
			$.post('ajax.php',{search_friend:'search_friend',str:str},function(data){
				$('#box_kq').html(data);
			});
		}else if(str!='') window.location = "index.html?user=<?php echo $idUser?>&type=friend&search="+str;
		$('#wrapper').click(function(){
			$("#box_kq").css('display','none');
		});
	});
});
</script>